{namespace flux=FluidTYPO3\Flux\ViewHelpers}

<f:if condition="{grid.rows -> f:count()} > 0">
	<div class="grid-visibility-toggle">
		<div class="toggle-content" data-uid="{row.uid}">
			<span class="t3-icon t3-icon-actions t3-icon-view-table-{flux:isCollapsed(record: row, then: 'expand', else: 'collapse')}"></span>
		</div>
		<f:render section="Grid" arguments="{_all}" />
	</div>
</f:if>

<f:section name="Grid">
	<table cellspacing="0" cellpadding="0" id="content-grid-{row.uid}" class="flux-grid{flux:isCollapsed(record: row, then: ' flux-grid-hidden')}">
		<tbody>
		<f:for each="{grid.rows}" as="gridrow" iteration="rowIteration">
			<tr>
				<f:for each="{gridrow.columns}" as="area" iteration="columnIteration">
					<td colspan="{area.colspan}" rowspan="{area.rowspan}" style="{area.style}">
						<flux:be.contentArea area="{area.name}" row="{row}">
							<div class="fce-header t3-row-header t3-page-colHeader t3-page-colHeader-label">
								<div>{area.label}</div>
							</div>
							<div class="fce-container t3-page-ce-wrapper">
								<div class="t3-page-ce">
									<div class="t3-page-ce-dropzone" id="colpos-{colPosFluxContent}-page-{row.pid}-{area.md5}-top-{row.uid}-{area.name}" style="height: 16px;">
										<div class="t3-page-ce-wrapper-new-ce">
											<flux:be.link.content.new row="{row}" area="{area.name}" />
											<flux:be.link.content.paste row="{row}" area="{area.name}" />
											<flux:be.link.content.paste row="{row}" area="{area.name}" reference="TRUE" />
										</div>
									</div>
								</div>
								<f:for each="{records}" as="record">
									<div class="t3-page-ce{f:if(condition: record.isDisabled, then: ' t3-page-ce-hidden')} {record._CSSCLASS}" id="element-tt_content-{record.uid}">
										<f:if condition="{dblist.tt_contentConfig.languageMode} == 0">
											<div class="t3-page-ce-dragitem">
										</f:if>
											<flux:be.contentElement row="{record}" dblist="{dblist}" />
										<f:if condition="{dblist.tt_contentConfig.languageMode} == 0">
											</div>
										</f:if>
										<div class="t3-page-ce-dropzone" id="colpos-{colPosFluxContent}-page-{row.pid}-{row.uid}-after-{record.uid}" style="height: 16px;">
											<div class="t3-page-ce-wrapper-new-ce">
												<flux:be.link.content.new after="{record.uid}" row="{row}" area="{area.name}" />
												<flux:be.link.content.paste row="{row}" relativeTo="{record}" area="{area.name}" />
												<flux:be.link.content.paste row="{row}" relativeTo="{record}" area="{area.name}" reference="TRUE" />
											</div>
										</div>
									</div>
								</f:for>
							</div>
						</flux:be.contentArea>
					</td>
				</f:for>
			</tr>
		</f:for>
		</tbody>
	</table>
</f:section>
